﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Bai1.Models;

namespace Bai1.Controllers
{
    public class HomeController : Controller
    {
        OdeToFoodDB _db = new OdeToFoodDB();
        //[Authorize(Users = "shailendra,mohan")]
        //[Authorize(Roles = "Admin,SubAdmin")]
        public ActionResult Index()
        {
            Session["User"] = 1;
            /*var controller = RouteData.Values["controller"];
            var action = RouteData.Values["action"];
            var id = RouteData.Values["id"];
            
            ViewBag.Thai = controller + "-"  + action + "-" + id;
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
              */
           /* var model = _db.Restaurants.ToList();
            return View(model);*/
            return View();
        }

        public string CallAjaxHelper(int id = 1)
        {
            return "Nguyen Thai Thinh";
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }
        protected override void Dispose(bool disposing)
        {
            if (_db!=null)
            {
                
            }
        }
    }
}
